package gui.keyActions;

import gui.MainPanel;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import dados.Curva;

public class SetAllPolygonalsVisibilityAction extends AbstractAction{
	private MainPanel target;
	private boolean visibility;
	
	public SetAllPolygonalsVisibilityAction(MainPanel target) {
		super();
		this.target = target;
		this.visibility = true;
	}

	@Override
	public void actionPerformed(ActionEvent arg0) {
		
		this.visibility = !this.visibility;
		this.target.getDrawPanel().setAllPolygonalsVisible(this.visibility);
		for (Curva c : this.target.getDrawPanel().getDraw().getCurves()) {
			c.setPolygonalVisible(this.visibility);
		}
		this.target.getButtonPanel().getCheckBoxPoligonais().setSelected(this.visibility);
		this.target.getDrawPanel().update();
	}
	
	
	
	
	
}
